package com.gs.netty.support.config;

import com.gs.netty.support.dispatch.WebSocketDispatch;
import com.gs.netty.support.handler.SocketAnnotationCommandMappingHandlerMapping;
import com.gs.netty.support.handler.adapter.WebSocketCommandMappingHandlerAdapter;
import com.gs.netty.support.resolver.ExceptionHandlerExceptionResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class WebSocketDispatchAutoConfiguration {

    @Bean
    public WebSocketDispatch webSocketDispatch(){
        return new WebSocketDispatch();
    }
    @Bean
    public WebSocketCommandMappingHandlerAdapter commandMappingHandlerAdapter(){
        return new WebSocketCommandMappingHandlerAdapter();
    }

    @Bean
    public SocketAnnotationCommandMappingHandlerMapping webSocketAnnotationCommandMappingHandlerMapping(){
        return new SocketAnnotationCommandMappingHandlerMapping();
    }


    @Bean
    public ExceptionHandlerExceptionResolver exceptionHandlerExceptionResolver(){
        return new ExceptionHandlerExceptionResolver();
    }


}
